<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<ui:composition>
<div class="row-fluid" style="background: #FFFFFF;">
	<div class="span1"></div>
	<div class="span10">
		<h3>Atualização de Cliente</h3>
		<br />
		
		<h:form prependId="false" id="formSelectCli">
			<div class="row-fluid">
				<div class="span3">
					<h:outputLabel for="cliente" value="Cliente: *" />
				</div>
				<div class="span5">
					<h:selectOneMenu id="cliente" value="#{atuClienteBean.clienteSelecionado}" styleClass="inputAjust" requiredMessage="Escolha o Cliente">
						<f:selectItem itemLabel="Selecione o Cliente" itemValue="" />
						<f:selectItems value="#{atuClienteBean.listaItemCliente}" />
						
						<f:ajax listener="#{atuClienteBean.carregarCliente()}" render=":formAtuCli"/>
					</h:selectOneMenu>
				</div>
				<div class="span2"></div>
			</div>
		</h:form>
		
		<h:form prependId="false" id="formAtuCli">
			<p:growl id="growl" sticky="true" showDetail="true" />
			
			<div class="row-fluid">
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="nome" value="Nome Completo: *" />
					</div>
					<div class="span5">
						<p:inputText id="nome" value="#{atuClienteBean.cliente.nome}" required="true" label="Nome Completo" requiredMessage="Digite o Nome" styleClass="inputAjustText"/>
					</div>
					<div class="span2"></div>
				</div>
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="telefone" value="Telefone: *" />
					</div>
					<div class="span5">
						<p:inputText id="telefone" value="#{atuClienteBean.cliente.telefone}" required="" label="Telefone" styleClass="inputAjustText"/>	
					</div>
					<div class="span2"></div>
				</div>
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="rua" value="Rua: *" />
					</div>
					<div class="span5">
						<p:inputText id="rua" value="#{atuClienteBean.cliente.rua}" required="false" label="Rua" styleClass="inputAjustText"/>	
					</div>
					<div class="span2"></div>
				</div>
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="email" value="Email: *" />
					</div>
					<div class="span5">
						<p:inputText id="email" value="#{atuClienteBean.cliente.email}" required="false" label="Email" styleClass="inputAjustText"/>	
					</div>
					<div class="span2"></div>
				</div>
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="funcao" value="Função: *" />
					</div>
					<div class="span5">
						<h:selectOneMenu id="funcao" styleClass="inputAjust" value="#{atuClienteBean.cliente.funcao}" requiredMessage="Selecione a Funcao" required="true">
							<f:selectItem itemLabel="Selecione a Funcao" itemValue=""/>
							<f:selectItem itemLabel="Membro(a)" itemValue="Membro(a)"/>
							<f:selectItem itemLabel="Diacono(isa)" itemValue="Diacono(isa)"/>
							<f:selectItem itemLabel="Presbitero" itemValue="Presbitero"/>
							<f:selectItem itemLabel="Missionáriá(o)" itemValue="Missionáriá(o)"/>
							<f:selectItem itemLabel="Pastor" itemValue="Pastor"/>
						</h:selectOneMenu>
					</div>
					<div class="span2"></div>
				</div>
				<div class="span12">
					<div class="span3">
						<h:outputLabel for="codCarteira" value="Codigo Carteira: *" />
					</div>
					<div class="span5">
						<p:inputText id="codCarteira" value="#{atuClienteBean.cliente.codCarteira}" required="false" label="Codigo Carteira" styleClass="campoCod"/>	
					</div>
					<div class="span2"></div>
				</div>		
				<div class="span12">
					<div class="span3">
						<p:commandLink id="btSalvar" styleClass="btn btn-default" actionListener="#{atuClienteBean.atualizaCliente}" icon="ui-icon-check" process=":formAtuCli" update=":formAtuCli" style="margin:0; margin-top:15px;">Salvar</p:commandLink>
					</div>
					<div class="span3">
						<p:commandLink id="btCancelar" styleClass="btn btn-default" action="#{atuClienteBean.cancelar()}" icon="ui-icon-check" style="margin:0; margin-left:10px; margin-top:15px;">Cancelar</p:commandLink>
					</div>
				</div>
				<div class="span12"></div>
				<div class="span12"></div>
			</div>
		</h:form>
	</div>
	<div class="span1"></div>
</div>
</ui:composition>
</html>